package com.cloud.logger.zchain.zchainserver.controller;

import com.cloud.logger.zchain.core.common.base.ResultMessage;
import com.cloud.logger.zchain.zchainserver.entity.ZchainLoggerIgnore;
import com.cloud.logger.zchain.zchainserver.service.ZchainLoggerIgnoreService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 浙江卓锐科技股份有限公司
 *
 * @author zhengyt
 * @create 2017/12/5
 * @description
 */
@RestController
@RequestMapping(value = "loggerIgnore")
@Api(value = "/日志忽略", description = "日志忽略接口")
public class ZchainLoggerIgnoreCtl {

    @Resource
    private ZchainLoggerIgnoreService zchainLoggerIgnoreService;

    @GetMapping("findCode/{code}")
    @ApiOperation(value = "通过项目编码查询")
    public ResultMessage findByCode(@PathVariable String code){
        return zchainLoggerIgnoreService.findByCode(code);
    }

    @PostMapping("")
    @ApiOperation(value = "保存忽略接口")
    public ResultMessage saveLogIgnore(@RequestBody ZchainLoggerIgnore zchainLoggerIgnore){
        return zchainLoggerIgnoreService.saveLogIgnore(zchainLoggerIgnore);
    }

    @DeleteMapping("{id}")
    @ApiOperation(value = "通过id删除忽略接口数据")
    public ResultMessage deleteLogIgnore(@PathVariable(value = "id") String id){
        return zchainLoggerIgnoreService.deleteLogIgnore(id);
    }


}